<template>
  <div class="businfoCard">
    <div :class="toLink ? 'espWidth' : ''">
      <div v-for="i in titleList">
        <van-row class="mgb20 appRow" >
          <van-col span="10" class="col">
            <div class="c9">{{ i[0].name }}</div>
            <div class="mgt8">{{ msglist[i[0].title] }}</div>
          </van-col>
          <van-col span="7"  class="col">
            <div class="c9">{{ i[1].name }}</div>
            <div class="mgt8">{{ msglist[i[1].title] }}</div>
          </van-col>
          <van-col span="7" v-if="i[2]"  class="col">
            <div class="c9">{{ i[2].name }}</div>
            <div class="mgt8">{{ msglist[i[2].title] }}</div>
          </van-col>
        </van-row>
      </div>
      <div v-for="i in lastList" class="mgb20">
        <div class="c9">{{ i.name }}</div>
        <div class="mgt8">{{ msglist[i.title] }}</div>
      </div>
    </div>
    <div class="tac prColor" @click="toLink = !toLink" v-if="toLink">
      <span><van-icon name="play" class="derote mgr8" /></span>查看更多信息
    </div>
    <div class="tac " @click="toLink = !toLink" v-else>
      <span><van-icon name="play" class="rote mgr8" /></span>收起
    </div>
  </div>
</template>
<style scoped>
@import "../../public.css";
@import "../../ui/vant-ui/ui.css";
.businfoCard {
  margin: 20px;
  background-color: #eeeeee65;
  border-radius: 5px;
  padding: 20px;
  font-size: 14px;
}
.rote {
  transform: rotate(-90deg);
}
.derote {
  transform: rotate(90deg);
}
.espWidth {
  height: 125px;
  overflow: hidden;
}
@media (max-width:500px) {
  .appRow{
    display: flex;
    flex-direction: column;
  }
  .businfoCard{
    padding: 10px !important;
    margin: 5px !important;
  }
  .mgt8{
    width: 240px;
    white-space:break-all;
  }
  .col{
    margin-top: 8px;
  }
}
</style>
<script>
module.exports = {
  data() {
    return {
      titleList: [
        [
          { name: "公司名称", title: "name" },
          { name: "法定代表人", title: "legalPerson" },
          { name: "成立日期", title: "createdTime" },
        ],
        [
          { name: "企业类型", title: "enterpriseType" },
          { name: "经营状态", title: "state" },
          { name: "注册资本", title: "createdMoney" },
        ],
        [
          { name: "营业期限", title: "createdAd" },
          { name: "所属地区", title: "operatingTerm" },
          { name: "注册地址", title: "city" },
        ],
        [
          { name: "统一社会信用代码", title: "cityCode" },
          { name: "核准日期", title: "examineDate" },
        ],
      ],
      lastList: [
        { name: "曾用名", title: "oldName" },
        { name: "登记机关", title: "registrationAuthority" },
        { name: "所属行业", title: "industry" },
        { name: "经营范围", title: "businessScope" },
      ],
      toLink: true,
    };
  },
  props: {
    msglist: {
      type: Object,
    },
  },
  methods: {},
};
</script>
